/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package weapons.hits;

import java.awt.Image;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import weapons.BurningArrow;
import weapons.SimpleArrow;
import weapons.Weapon;

/**
 *
 * @author RoKe
 */
public class Treffer {

    private int x, y;
    private Image image;
    boolean visible;
    private int lifetime = 50;
    public Treffer(int x, int y, Weapon w) {
        if(w instanceof SimpleArrow)
        {
        ImageIcon ii = new ImageIcon(this.getClass().getResource("Explosion.gif"));
        image = ii.getImage().getScaledInstance(40, 40, 1);
        }
        if(w instanceof BurningArrow)
        {
        ImageIcon ii = new ImageIcon(this.getClass().getResource("Explosion.gif"));
        image = ii.getImage().getScaledInstance(40, 40, 1);    
        }
        visible = true;
        this.x = x;
        this.y = y;
    }
    public void reduceLifetime()
    {
        lifetime --;
    }
    public Image getImage() {
        return image;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getLifetime() {
        return lifetime;
    }

}
